import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@ant-design/compatible': '@ant-design/compatible/es',
    }
  },
  optimizeDeps: {
    exclude: ['@ant-design/cssinjs', 'antd/es/theme/util/alias']
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
        modifyVars: {
          'primary-color': '#1DA57A',
          'link-color': '#1DA57A',
          'border-radius-base': '2px',
        },
      }
    }
  },
  define: {
    global: 'globalThis',
  }
})
